package com.woniuxy.microsysserver.controller;

import com.woniuxy.common.bean.ResultMsg;
import com.woniuxy.microsysserver.bean.DepartmentInfo;
import com.woniuxy.microsysserver.service.IDepService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("dep")
public class departmentController {

    @Resource
    private IDepService depServiceImpl;

    @GetMapping("/all")
    ResultMsg findAll(){
        List<DepartmentInfo> all = depServiceImpl.findAll();
        ResultMsg resultMsg = new ResultMsg(true);
        resultMsg.setData(all);
        return resultMsg;
    }
}
